package com.smart.reader.model.vo;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;

@ApiModel("用户信息视图对象")
@Getter
@Setter
public class SysUserInfoVo {
    @ApiModelProperty(value = "用户ID", example = "1")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty(value = "用户名", example = "zhangsan", required = true)
    private String userName;

    @ApiModelProperty(value = "电话号码", example = "13800138000")
    private String phoneNumber;

    @ApiModelProperty(value = "头像地址", example = "https://example.com/avatar.jpg")
    private String avatarAddress;

    @ApiModelProperty(value = "姓名", example = "张三", required = true)
    private String fullName;

    @ApiModelProperty(value = "创建时间", example = "2023-07-15 10:30:00")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间", example = "2023-07-20 14:45:00")
    private LocalDateTime updateTime;

    // 空构造器
    public SysUserInfoVo() {
    }

    // 全参构造器（方便 Mapper 使用）
    public SysUserInfoVo(Long id, String userName, String phoneNumber,
                         String avatarAddress, String fullName,
                         LocalDateTime createTime, LocalDateTime updateTime) {
        this.id = id;
        this.userName = userName;
        this.phoneNumber = phoneNumber;
        this.avatarAddress = avatarAddress;
        this.fullName = fullName;
        this.createTime = createTime;
        this.updateTime = updateTime;
    }


    // toString 方法
    @Override
    public String toString() {
        return "SysUserInfoVo{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", phoneNumber='" + phoneNumber + '\'' +
                ", avatarAddress='" + avatarAddress + '\'' +
                ", fullName='" + fullName + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';

    }
}